import App from "./App.vue"
import Vue from "vue"
import  VueRouter from "vue-router"
Vue.use(VueRouter)

// import VueResource from "vue-resource";
// Vue.use(VueResource);

import { Header,Swipe, SwipeItem  } from 'mint-ui';
Vue.component(Header.name, Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);

import router from "./router.js"
// 导入样式
import "./lib/mui/css/mui.min.css";
import "./lib/mui/css/icons-extra.css"

Vue.component(Header.name, Header);

import axios from 'axios'

axios.defaults.timeout = 3000  // 响应时间
// 这里的http://localhost:8080为本地接口，在开发中需要换成真实的接口
axios.defaults.baseURL = '' 
// 为Vue添加一个原型属性$http指向axios 
Object.defineProperty(Vue.prototype, '$http', {
  value: axios
})
// Vue.use(axios);

new Vue({
    el:"#app",
    render:c => c(App),
    router
})
router.beforeEach((to,from,next)=>{
    if(to.meta.title){
        document.title = to.meta.title
    }
    next()
})